package com.example.bluetoothttss;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class HistoryActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_history);

        // 获取传递过来的历史记录数据
        String historyData = getIntent().getStringExtra("history_log");

        // 找到布局文件中的TextView
        TextView tvHistory = findViewById(R.id.tvHistory);

        // 设置历史记录文本
        tvHistory.setText(historyData);
        Button returnbut=findViewById(R.id.btn_return);
        returnbut.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent re = new Intent(HistoryActivity.this, MainActivity.class);
                startActivity(re);
            }
        });

    }
}